package com.jmp.chat;

import java.util.Objects;

public enum MsgType {
    /**
     * 系统通知
     */
    TEXT("%s", ""),
    /**
     * 企业申请
     */
    SysMsgCompanyApply("用户%s申请加入企业,点击查看详情", ""),
    ;

    private String data;
    private String text;

    MsgType(String text, String data) {
        this.text = text;
        this.data = data;
    }

    public String getText(Object[] params) {
        if (Objects.isNull(params) || params.length <= 0) {
            return text;
        } else {
            return String.format(text, params);
        }
    }

    public String getData(Object[] params) {
        if (Objects.isNull(params) || params.length <= 0) {
            return data;
        } else {
            return String.format(data, params);
        }
    }
}
